﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CommonEntity.CommonImageEntities;
using CommonEntity.Handlers;
using OpenCvSharp;
using ScienceAppService.Entities;
using ScienceRpcServe.Protos;
using Point3d = CommonEntity.CommonImageEntities.Point3d;

namespace ScienceAppService.ModuleInterface;
public interface IImageShowService : IAppBaseService
{
    /// <summary>
    /// 图像刷新事件
    /// </summary>
    public event CommonHandler<FrushMats> FrushMatsEvent;

    /// <summary>
    /// 图像信息刷新事件
    /// </summary>
    public event CommonHandler<ImageInfo> FrushImageInfoEvent;

    /// <summary>
    /// 窗宽窗位刷新
    /// </summary>
    public event CommonHandler<object?> WindowAdjustChangeEvent;

    public event CommonHandler<string> FrushSeriesDescriptionEvent;

    /// <summary>
    /// 十字线subMenu刷新
    /// </summary>
    public event CommonHandler<CrossLineInfo>? FrushCrosslineInfoEvent;

    /// <summary>
    /// 实现先Mat刷新
    /// </summary>
    public event CommonHandler<CrossLineMat>? FrushCrosslineMatsEvent;

    /// <summary>
    /// 刷新TagMat
    /// </summary>
    public event CommonHandler<Mat>? FrushTagMatEvent;

    /// <summary>
    /// 图像获取
    /// </summary>
    /// <param name="index"></param>
    /// <param name="orientation"></param>
    /// <returns></returns>
    public Task FrushMats(int index, ImageOrientationEnum orientation);

    public Task FrushAllOrientationMats(Point3d p);

    /// <summary>
    /// 获取对应十字线 ct 值
    /// </summary>
    /// <param name="p"></param>
    /// <returns></returns>
    public Task<int> GetCtVal(int[] p);


    /// <summary>
    /// 十字线获取
    /// </summary>
    /// <param name="p"></param>
    /// <param name="orientation"></param>
    /// <returns></returns>
    public Task FrushCrossLine(int[] p);


    public Task SetImageFile(SplitSeriesInfo seriesInfo);

    public Task SetNiiGzFile(string dir);

    /// <summary>
    /// 设置图像信息
    /// </summary>
    /// <returns></returns>
    public Task SetImageInfo();

    public Task AdjustWindow(int startVal, int endVal);

    /// <summary>
    /// 获取tag图像
    /// </summary>
    /// <returns></returns>
    public Task<Mat> GetTagInfoMat();
}
